package kr.ac.kaist.vrowser;

import kr.ac.kaist.vrowser.application.VrowserApplication;
import android.content.res.Resources;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.util.DisplayMetrics;

public class VrowserBaseActivity extends FragmentActivity {

	protected VrowserApplication app;
	protected VrowserBaseActivity activity;
		
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		app = (VrowserApplication) getApplicationContext();
		activity = this;
	}
	
	@Override
	protected void onResume() {
		super.onResume();
		try {
			Resources res = app.getResources();
		    // Change locale settings in the app.
		    DisplayMetrics dm = res.getDisplayMetrics();
		    android.content.res.Configuration conf = res.getConfiguration();
		    conf.locale = app.getTextToSpeech().getLanguage();
		    res.updateConfiguration(conf, dm);
		} catch (Exception e) {
		}
	}
	
}
